package org.ssssssss.magicapi.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    //根据我们前面设计的返回值，来设计这些参数
    private boolean success;
    private int code;
    private String msg;
    private Object data;  //这个data里面就是连表查询，包括文章表和标签表里面的东西

    //然后根据不同转态，最好还要设计两个方法
    public static Result success(Object data){
        return new Result(true,200,"success",data);
    }
    public static Result success(String msg, Object data){
        return new Result(true,200,"success",data);
    }
    public static Result fail(int code, String msg){
        return new Result(false,code,msg,null);
    }
}
